home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1998 October / EnigmA AMIGA RUN 31 (1998)(G.R. Edizioni)(IT)[!][issue 1998-10].iso / earkit / chat / amarquee / pcq / amarquee.i next >
Text File  |  1998-09-22  |  7KB  |  147 lines

  1. { AMarquee.i for PCQ Pascal }
  2. { Translated from file AMarquee.h }
  3. { by Jeremy Friesner }
  4.  
  5. {$I "Include:Exec/Ports.i"}
  6.  
  7. type 
  8.  
  9. {***** QMessage ***************************************************}
  10.  
  11.   QMessage = record
  12.   qm_Msg : Message;       { Don't directly use the contents of qm_Msg! }
  13.   qm_ID  : Integer;       { Message ID # of transaction related to this opCode, or -1 if no ID is applicable. }
  14.   qm_Status : Integer;    { One of the QERROR_* codes defined in AMarquee headers. }
  15.   qm_Path : String;       { Pathname of a node, or NULL if not applicable. }
  16.   qm_Data : Address;      { Pointer to beginning of data buffer, or NULL if not applicable. }
  17.   qm_DataLen : Integer;   { Length of qm_Data buffer, or 0 if not applicable. }
  18.   qm_ActualLen : Integer; { Length of the data buffer stored on the AMarquee server. }
  19.   qm_ErrorLine : Integer; { Line # of the server source code that generated the error.  Useful for debugging. }
  20.   qm_Private : Address;   { Private info used by FreeQMessage() }
  21.   end;
  22.   QMessagePtr = ^QMessage;
  23.   
  24. {***** QSession ***************************************************}
  25.  
  26.   QSession = record
  27.   qMsgPort : MsgPortPtr;  { Wait() on this for QMessages! }
  28.   {******************************************************************}
  29.   { Invisible, private info is here... don't trust sizeof(QSession)! }
  30.   {******************************************************************}
  31.   end;
  32.   QSessionPtr = ^QSession;
  33.  
  34. {***** QRunInfo ***************************************************}
  35.  
  36.   QRunInfo = record
  37.   qr_Allowed : Integer; { The theoretical maximum number of bytes your server may allocate. }
  38.   qr_Alloced : Integer; { The number of bytes currently allocated by your server. }
  39.   qr_Avail   : Integer; { The number of bytes that may actually be allocated by your server. }
  40.   qr_CurrentPrivs  : Integer; { The bit-chord of QPRIV_* privileges that your client has. }
  41.   qr_PossiblePrivs : Integer; { The bit-chord of QPRIV_* privileges that your client could get if it asked for them. }
  42.   end;
  43.   QRunInfoPtr = ^QRunInfo;
  44.  
  45. { Different error types that can be returned to the client in QMessages }
  46. const
  47.     QERROR_NO_ERROR        =  0; { Everything is okay }
  48.     QERROR_UNKNOWN         = -1; { Don't know what the error was. }
  49.     QERROR_MALFORMED_KEY   = -2; { Keystring could not be parsed or "dir" does not exist }
  50.     QERROR_NO_SERVER_MEM   = -3; { Server did not have enough mem available to complete request }
  51.     QERROR_NO_CONNECTION   = -4; { The connection to the server went south }
  52.     QERROR_UNPRIVILEGED    = -5; { You're not allowed to do that! }
  53.     QERROR_UNIMPLEMENTED   = -6; { Feature you requested does not exist yet }
  54.     QERROR_NO_CLIENT_MEM   = -7; { Your computer didn't have enough memory available to complete an action }
  55.     QERROR_SYS_MESSAGE     = -8; { This message is a text message from the sysadmin on the server }
  56.     QERROR_SEND_DONE       = -9; { Sent in response to a transmission completion, if QGO_NOTIFY used in the QGo() call }
  57.  
  58. { These error types may be returned by QFreeSession() after a QSession }
  59. {   allocation attempt fails. }
  60.     QERROR_NO_TCP_STACK    = -20; { TCP stack wasn't running }
  61.     QERROR_HOSTNAME_LOOKUP = -21; { Hostname lookup of server failed }
  62.     QERROR_ABORTED         = -22; { TCP thread got a control-C }
  63.     QERROR_NO_SERVER       = -23; { No AMarquee server at requested host/port }
  64.     QERROR_NO_INETD        = -24; { The program wasn't launched by inetd }
  65.     QERROR_ACCESS_DENIED   = -25; { The server wouldn't accept our connection }
  66.  
  67. { Flags representing special privileges; used with QRequestPrivileges(), etc }
  68.     QPRIV_KILLCLIENTS       = $1; { Can forcible disconnect other clients }
  69.     QPRIV_ADMIN             = $2; { Can change ENV variables on server }
  70.     QPRIV_GETSYSMESSAGES    = $4; { Can receive system messages }
  71.     QPRIV_SENDSYSMESSAGES   = $8; { Can send system messages }
  72.         
  73.     QPRIV_ALL               = $F; { all QPRIV_* bits or'd together }
  74.  
  75. { Flags to use with QGo() }
  76.     QGOF_SYNC               = $1;   { Send a sync packet when all has settled }
  77.     QGOF_NOTIFY             = $2;   { Send a notify packet when transmit has finished}
  78.  
  79. { Function prototypes }
  80. { Translated from file AMarquee_protos.h }
  81. { by Jeremy Friesner }
  82.  
  83. Function QNewSession(hostname : String; port : Integer; progname : String) : QSessionPtr;
  84.     External;
  85. Function QNewSessionAsync(hostname : String; port : Integer; progname : String) : QSessionPtr;
  86.     External;
  87. Function QFreeSession(session : QSessionPtr) : Integer;
  88.     External;
  89. Function QDebugOp(session : QSessionPtr; string : String) : Integer;
  90.     External;
  91. Function QGetOp(session : QSessionPtr; wildpath : String; maxBytes : Integer) : Integer;
  92.     External;
  93. Function QDeleteOp(session : QSessionPtr; wildpath : String) : Integer;
  94.     External;
  95. Function QRenameOp(session : QSessionPtr; path : String; newname : String) : Integer;
  96.     External;
  97. Function QSubscribeOp(session : QSessionPtr; wildpath : String; maxBytes : Integer) : Integer;
  98.     External;
  99. Function QSetOp(session : QSessionPtr; path : String; buffer : Address; bufferLength : Integer) : Integer;
  100.     External;
  101. Function QClearSubscriptionsOp(session : QSessionPtr; which : Integer) : Integer;
  102.     External;
  103. Function QPingOp(session : QSessionPtr) : Integer;
  104.     External;
  105. Function QInfoOp(session : QSessionPtr) : Integer;
  106.     External;
  107. Function QSetAccessOp(session : QSessionPtr; newAccess : String) : Integer;
  108.     External;
  109. Function QGo(session : QSessionPtr; flags : Integer) : Integer;
  110.     External;
  111. Procedure FreeQMessage(session : QSessionPtr; qmsg : QMessagePtr);
  112.     External;
  113. Function QNewHostSession(hostnames : String; port : ^Integer; progNames : String) : QSessionPtr;
  114.     External;
  115. Function QStreamOp(session : QSessionPtr; path : String; buffer : Address; bufferLenggth : Integer) : Integer;
  116.     External;
  117. Function QNewServerSession(hostNames : String; progNames : String) : QSessionPtr;
  118.     External;
  119. Function QSetMessageAccessOp(session : QSessionPtr; newAccess : String; maxBytes : Integer) : Integer;
  120.     External;
  121. Function QMessageOp(session : QSessionPtr; hosts : String; buffer : Address; bufferLength : Integer) : Integer;
  122.     External;
  123. Function QNumQueuedPackets(session : QSessionPtr) : Integer;
  124.     External;
  125. Function QNumQueuedBytes(session : QSessionPtr) : Integer;
  126.     External;
  127. Function QErrorName(error : Integer) : String;
  128.     External;
  129. Function QRequestPrivilegesOp(session : QSessionPtr; privBits : Integer) : Integer;
  130.     External;
  131. Function QReleasePrivilegesOp(session : QSessionPtr; privBits : Integer) : Integer;
  132.     External;
  133. Function QKillClientsOp(session : QSessionPtr; hosts : String) : Integer;
  134.     External;
  135. Function QSetParameterOp(session : QSessionPtr; paramName : String; newValue : String) : Integer;
  136.     External;
  137. Function QGetParameterOp(session : QSessionPtr; paramName : String) : Integer;
  138.     External;
  139. Function QSysMessageOp(session : QSessionPtr; hosts : String; message : String) : Integer;
  140.     External;
  141. Function QGetAndSubscribeOp(session : QSessionPtr; path : String; buffer : Address; bufferLength : Integer) : Integer;
  142.     External;
  143. Function QDetachSession(session : QSessionPtr; flags : Integer) : Boolean;
  144.     External;
  145. Function QReattachSession(session : QSessionPtr; flags : Integer) : Boolean;
  146.     External;
  147.